package net.penguinmenac3.math;

/**
 * This is an interface used to make the gausian algorithm applicable on any group.
 * 
 * @author Michael
 */
public interface MathObject {
	/**
	 * Add two MathObjects to each other if they fit.
	 * Otherwise throw an IllegalArgumentException.
	 * @param o
	 */
	public MathObject add(MathObject o);
	
	/**
	 * Subtract two MathObjects to each other if they fit.
	 * Otherwise throw an IllegalArgumentException.
	 * @param o
	 */
	public MathObject subtract(MathObject o);
	
	/**
	 * Multiply two MathObjects to each other if they fit.
	 * Otherwise throw an IllegalArgumentException.
	 * @param o
	 */
	public MathObject multiply(MathObject o);
	
	/**
	 * Divide two MathObjects to each other if they fit.
	 * Otherwise throw an IllegalArgumentException.
	 * @param o
	 */
	public MathObject divide(MathObject o);
	
	/**
	 * Returns true if this is a neutral element.
	 * @return
	 */
	public boolean isNeutralElement();
	
	/**
	 * Returns true if this is a neutral element.
	 * @return
	 */
	public boolean isNullElement();

	/**
	 * Create a real clone not only a reference clone.
	 * @return
	 */
	public MathObject clone();
	
	/**
	 * Returns the value as a plain string not shortened.
	 */
	public String getValue();
	
	/**
	 * Return the inverse of the current number.
	 * @return
	 */
	public MathObject inverse();
	
	/**
	 * Return the inverse of the current number related to an addition operation.
	 * @return
	 */
	public MathObject additiveInverse();
}
